/*
 * 饿汉式
 */
public class Singleton1 {
	String name = null;
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	 public void printInfo() {  
	        System.out.println("the name is " + name);  
	 }  
	private Singleton1(){}
	private static final Singleton1 single = new Singleton1();
	
	public static Singleton1 getInstace(){
		return single;
	}
}
